package com.focus.pay.wx.action.v2;

import com.focus.pay.wx.config.WxPayConfig;
import com.focus.pay.core.annation.PayOrderHandler;
import com.focus.pay.core.enums.ChannelTypeEnum;
import com.focus.pay.core.enums.Version;
import com.focus.pay.core.exception.PayException;
import com.focus.pay.wx.model.order.v2.WxPayModelUnifiedResponse;

/**
* @Author: 赵参谋
* @Date: 2021/10/13 16:39
* @Description: 微信扫码支付Native
 * <link>https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1</link>
*/
@PayOrderHandler(channelType = ChannelTypeEnum.WxType.Native,version = Version.VERSION_2)
public class WxPayOrderNative extends WxPayOrderJSAPI {

    @Override
    public WxPayModelUnifiedResponse handle(String res, WxPayConfig wxPayConfig) throws PayException {
        WxPayModelUnifiedResponse wxPayModelUnifiedResponse = super.resolvingResult(res, WxPayModelUnifiedResponse.class);
        wxPayModelUnifiedResponse.setPageData(wxPayModelUnifiedResponse.getCode_url());
        return wxPayModelUnifiedResponse;
    }
}
